//
//  UITableView+Refresh.m
//  StaffTax
//
//  Created by 侯伟 on 2020/1/10.
//  Copyright © 2020 侯伟. All rights reserved.
//

#import "UITableView+Refresh.h"

@implementation UITableView (Refresh)

static char keyListDatas;
static char keyPageIndex;

- (void)setDatas:(NSMutableArray *)datas{
    objc_setAssociatedObject(self, &keyListDatas, datas, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
    
    [self reloadData];
}

- (NSMutableArray*)datas{
   NSMutableArray* x =  objc_getAssociatedObject(self, &keyListDatas);
    return x;
}

- (void)setPageIndex:(NSInteger)pageIndex{
    objc_setAssociatedObject(self, &keyPageIndex, @(pageIndex), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSInteger)pageIndex{
    return  [objc_getAssociatedObject(self, &keyPageIndex) integerValue];
}
@end
